The present invention generally relates to data processing, and, more particularly, to a program optimizer and to an optimization method.
The optimization of software programs is important to save memory space, to speed up program execution and to verify program operation. Program resources are, for example, variables, the bits in flag registers, or the information stored in memory arrays. There is a task to reduce the number of program resources (e.g., variables) and source code words (e.g., instructions). A useful reference for optimization is: [1] Cliff Rick: xe2x80x9cGlobal Code Motion, Global Value Numberingxe2x80x9d, ACM SIGPLAN 1995, La Jolla, Calif. USA, pages 246-257. An optimizer obtains the so called xe2x80x9clive informationxe2x80x9d of resources by distinguishing whether (a) a resource accessed by an instruction is used further in the software program (xe2x80x9cUSE-resourcesxe2x80x9d) or (b) the resource is not further used (xe2x80x9cEXH-resourcexe2x80x9d) and considered exhausted.
Optimizers for high level programming language, such as, for example, C or PASCAL are known. However, saving resources in assembly language programs is more complex due to many global variables in such programs. The optimizer must analyze a program, modify the program and analyze it again. Such an approach is time and memory consuming.
The present invention seeks to provide a program optimizer which mitigates or avoids disadvantages and limitations of the prior art.